//
//  WeiboApiRobotClient.m
//  Echo
//
//  Created by Liao on 14/12/17.
//  Copyright (c) 2014年 sina. All rights reserved.
//

#import "WeiboApiRobotClient.h"

@implementation WeiboApiRobotClient

+ (instancetype)sharedClient {
    static WeiboApiRobotClient *_sharedClient = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _sharedClient = [[WeiboApiRobotClient alloc] initWithBaseURL:[NSURL URLWithString:WEIBO_API_BASE_URL]];
        _sharedClient.requestSerializer = [AFJSONRequestSerializer serializer];
        NSString *robot_auth = [NSString stringWithFormat:@"Basic %@", ROBOT_AUTH_STR];
        [_sharedClient.requestSerializer setValue:robot_auth forHTTPHeaderField:@"Authorization"];
    });
    return _sharedClient;
}

@end
